package com.service.admin.impl;

import com.dao.ManagerDao;
import com.service.admin.AdminLoginService;
import com.utils.SqlSessionGetter;

import org.apache.ibatis.session.SqlSession;
import org.springframework.stereotype.Service;

/** 管理员登录服务类 主要负责提供管理员的功能实现 */
@Service
public class AdminLoginServiceImpl implements AdminLoginService {

  @Override
  public int login(String name, String pswd) {
    SqlSession session = SqlSessionGetter.getSqlSession();
    ManagerDao dao = session.getMapper(ManagerDao.class);
    int ret = dao.selectLogin(name, pswd);
    session.close();
    return ret;
  }
}
